// Copyright (c) 2009 Hypirinha contributers
// This program is made available under the terms of the MIT License.
package org.hypirinha.html.codegen;

import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.PrintStream;
import java.io.ByteArrayOutputStream;

public class AbstractMethodTest {

    @Test
    public void shouldRenderAsASingleLineWithIndent() {
        assertEquals("\n    Td td(Td.Attribute... attributes);\n", print(new AbstractMethod("td", "Td", "Td.Attribute... attributes")));
    }

    private String print(Member member) {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        member.printTo(new PrintStream(outputStream));
        return new String(outputStream.toByteArray());
    }
}